package eu.sudparis.it.opp.demo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import eu.sudparis.it.opp.TimeSeries;
import eu.sudparis.it.opp.ex.TraceFilter;
import eu.sudparis.it.opp.observfram.ObserverFrameWork;

public class ObserverDemo {
	static{

	}
	
	public static void main(String[] args) {
		DNode pro=new DNode();
		GraphAnalysis ga=new GraphAnalysis();
		ga.path="E://infocom06";
		ObserverFrameWork kfw=new ObserverFrameWork();
		kfw.filter=new TraceFilter(){

			@Override
			public boolean filter(int ida, int idb, long start_time, long end_time) {
				// TODO Auto-generated method stub
				return ida>=21&&idb>=21&&ida<=99&&idb<=99&&(end_time-start_time)>=60*75;
			//	return true;
			}
			
		};
		kfw.setProperty(pro);
		TimeSeries ts=kfw.load(args);
		DNode.ts=ts;
		ts.interceptor=ga;
		ts.run();
		List<Double> sorted=new ArrayList<Double>(DNode.simvspause.keySet());
		Collections.sort(sorted);
		double sum=0;
		for(double  sim :sorted){
			double avg=DNode.simvspause.get(sim).doubleValue();
			sum+=avg;
			DNode.ps
			 .println(sim+"\t"+DNode.min.get(sim)+"\t"+DNode.max.get(sim)+"\t"+sum);
		}
		System.out.println(sum);
	}
}
